# -*- coding: UTF-8 -*-
from pylons import session
class tmpValues(object):
    def pushsession(self, key, value):
        tmpvalues = {}
        if '__tmpValues' in session:
            tmpvalues = session['__tmpValues']
        else:
            session['__tmpValues'] = tmpvalues
        tmpvalues[key] = value
    
    def popsession(self, key):
        if '__tmpValues' in session:
            tmpvalue = session['__tmpValues']
            if key in tmpvalue:
                return tmpvalue[key]
        
    def getsession(self):
        if '__tmpValues' in session:
            return session['__tmpValues'].copy()
        
    def clearsession(self):
        if '__tmpValues' in session:
            session['__tmpValues'] = {}
